<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
    <style>
        #app{
            font-family: sans-serif;
            border: 1px solid #eee;
            border-radius: 2px;
            padding: 20px 30px;
            margin-top: 1em;
            margin-bottom: 40px;
            user-select: none;
            overflow-x: auto;
        }
    </style>
</head>
<body>
    <div id="app">
        <input v-focus/>
    </div>

    <script>
        const AppComp={
            data() {
                return {
                    
                }
            }
        }

        const app = Vue.createApp(AppComp)
        app.directive("focus",{
                    mounted(el) {
                        el.focus()
                    },
                })
        const vm = app.mount("#app")
    </script>
</body>
</html>